#！/usr/bin/python
# _*_ coding:UTF-8 -*-
import os
import pandas as pd
from datetime import datetime
import config as config
from tqdm import tqdm

def getTdxFile():
    '''
    从通达信导出目录读取今天的行情
    '''
    # cur = datetime.now().strftime('%Y%m%d')
    cur = '20210916'
    path = config.tdx['daily_path'] +cur+'.txt'
    # print(path)
    columns=list('abcdefghijklmnopqrstu')
    daily = pd.read_csv(path, sep='\t',header=0,dtype={0:str}, encoding='gbk',names=columns)[0:-1]
    # print(daily)
    columns_new= ['code','begin','high','low','close','vol','money','rate','liang','hands']
    df1=daily[list('almndhq')]
    df2=daily[list('crk')]
    df = pd.concat([df1,df2],axis=1)
    df.columns = columns_new #直接修改列名
    # df = pd.concat([df1,df2],axis=1)
    print(df)
    #循环计算个代码均值

def computeMaByDaily(df):
    pass
 